<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .content{
            width: 740px;
            display: flex;
            margin: 20px auto;
            /* justify-content: center; */
            /* align-items: center; */
            margin-top: 30px;
            border: 1px solid #000;
        }
        .left{
            display: flex;
            flex-wrap: wrap;
            width: 350px;
            margin-left: 20px;
            margin-top: 20px;
        }
        .kuai{
            width: 40px;
            height: 30px;
            border: 1px solid red;
            text-align: center;
            line-height: 30px;
        }
        #kuai{
            width: 40px;
            height: 30px;
            border: 1px solid red;
            margin-bottom: 20px;
        }
        .big{
            width: 200px;
            height: 30px;
            background: #ccc;
            position: relative;
            margin:0 30px;
        }
        .tiao{
            width: 0px;
            height: 30px;
            background:pink;
        }
        .ctrl{
            width: 20px;
            height: 40px;
            background: skyblue;
            position:absolute;
            left:-10px;
            top:-5px;
        }
        .right{
            display: flex;
            flex-wrap: wrap;
            margin-left: 20px;
            margin-top: 20px;
            width: 350px;
        }
        .div{
            display: flex;
        }
    </style>
</head>
<body>
    <div class="content">
        <div class="left">
           <div class="div">
                <div class="kuai">0</div>
            <div class="big">
                    <div class="tiao"></div>
                    <div class="ctrl"></div>
            </div>
            <div class="kuai" id="kuai"></div>
           </div>
           

           <div class="div">
                <div class="kuai">0</div>
            <div class="big">
                    <div class="tiao"></div>
                    <div class="ctrl"></div>
            </div>
            <div class="kuai" id="kuai"></div>
           </div>
            
           <div class="div">
                <div class="kuai">0</div>
            <div class="big">
                    <div class="tiao"></div>
                    <div class="ctrl"></div>
            </div>
            <div class="kuai" id="kuai"></div>
           </div>
        </div>
        <div class="right">
                <div class="div">
                        <div class="kuai">0</div>
                    <div class="big">
                            <div class="tiao"></div>
                            <div class="ctrl"></div>
                    </div>
                    <div class="kuai" id="kuai"></div>
                   </div>

                   <div class="div">
                        <div class="kuai">0</div>
                    <div class="big">
                            <div class="tiao"></div>
                            <div class="ctrl"></div>
                    </div>
                    <div class="kuai" id="kuai"></div>
                   </div>
         </div>
    </div>
    <script>
        function $(ele){
            return document.querySelectorAll(ele);
        }
        for(let i=0;i<$('.ctrl').length;i++){
        function move(e){
            e==e||window.event;
            let x=e.clientX-$('.big')[i].offsetLeft-10;
            x=x>200?200:x;
            x=x<0?0:x;
            $('.tiao')[i].style.width=x+'px';
            $('.ctrl')[i].style.left=x+'px';
            $('#kuai')[i].innerText=x/2;

        }
       
       $('.ctrl')[i].onmousedown=function(){
            document.addEventListener('mousemove',move,false);
        }
       $('.ctrl')[i].onmouseup=function(){
            document.removeEventListener('mousemove',move,false);
        }
       }
       
    </script>
</body>
</html>